package puziran.sofa.serializer;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class JsonResponse {
	private static Log log = LogFactory.getLog(JsonResponse.class);
	public String responseJson(HttpServletResponse response, String str) {
		try {
			response.setContentType("application/json;charset=utf-8");
			response.setCharacterEncoding("utf-8");
			PrintWriter pw = response.getWriter();
			pw.write(str);
			pw.flush();
		} catch (IOException e) {
			log.error("JsonResponse=>responseJson:" + e);
			e.printStackTrace();
		}
		return null;
	}
}